package models;

import java.sql.ResultSet;
import java.sql.SQLException;

public class 
HasSongModel 
extends AbstractModel
{	public boolean insert(Integer upc, String title)
	{	try{
			ps = con.prepareStatement("INSERT INTO HasSong VALUES (?,?)");
			ps.setInt(1,upc.intValue());
			ps.setString(2,title);
			
			return wrapUp();
		} catch(SQLException ex){ return registerException(ex); }
	}

	public boolean
	delete(int upc, String title)
	{	try
		{	ps = con.prepareStatement("DELETE FROM HasSong WHERE upc = ? AND title = ?");
		    ps.setInt(1, upc);
		    ps.setString(2,title);
		
		   return wrapUp();
		} catch (SQLException ex) {
		    return registerException(ex);
		}
	}
	
	public ResultSet
	show()
	{ return super.show("HasSong"); }
}
